﻿@model News
@{
    ViewBag.Title = Model.Title;
}


@using Web.Extensions;

@section HEAD{
    <script src="@Url.Content("~/Content/js/application.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/js/jquery.fileupload-ui.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/js/jquery.fileupload.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/css/jquery.fileupload-ui.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/js/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.css")" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="@Url.Content("~/Content/js/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.js")"></script>
  
    <meta property="og:title" content='GoodWorx-Новости: @Model.Title' />
    <meta property="og:type" content="activity"/>
    <meta property="og:url" content='@Url.ActionAbsolute("News","View", Model.Id )'/>
    <meta property="og:image" content='@(Model.NewsAvatar != null ? Model.NewsAvatar.Small.OriginalSizeUrl : Url.Absolute("/Content/img/logo_medium.jpg").ToString())' />
    <meta property="og:site_name" content="GoodWorx"/>
    @*<meta property="fb:admins" content="USER_ID"/>*@
    <meta property="og:description" content='@Model.ShortContent' />
}

<div id="main_inner">
    @if (Model.IsHidden)
    {
        <h1 class="warning">Новость скрыта. Сейчас она доступна только Вам</h1>
    }
        <span class="newsDateCreated">
            Добавлено @Model.DateCreated.ToString("dd MMMM yyyy (HH:mm)")
        </span>
    
    <h1 class="editTitleText_field" id="pageHeader" name="editTitleText_field">
        <span class="editTitleText_field0">
            @(Model.Title)
        </span><a href="#" rel="editTitleText" class="editButton_edit editButton">Редактировать</a>
    </h1>
    <form action="@Url.Action("ChangeTitle")" method="post" class="ajaxForm_noReload" name="editTitleText_form">
    <input type="hidden" name="id" class="newsEditing" value="@(Model.Id)"/>
    <input type="text" name="editTitleText_input" 
            class="editionInput editTitleText_input0 editTitleText_input" 
            id="editTitleText_input" value="@(Model.Title)" 
            placeholder="Все на субботник"
            maxlength="100"/>
    <br class="editionInput" />
    <input type="submit" class="editButton_submit editionInput editTitleText_input" value="Сохранить"
        name="editTitleText" />
    <input type="reset" class="editButton_cancel editionInput editTitleText_input" value="Отмена"
        name="editTitleText" />
    </form>
    <div id="project_rightCol">
        @Html.Action("Column", "Photo", new { story = Model })
        @if (ViewBag.EditMode)
        {//If user participates in this project
@*<a href="#" class="showLightBox_link mouseoverShow" rel="addPhotoBox">Добавить фото</a>*@
            @Html.ActionLink("Добавить фото", "UploadPhotos", "Photo", new { storyType = Model.GetType().FullName, id = Model.Id, returnUrl = Url.Action("View", "News", new { id = Model.Id }) }, new { @class = "mouseoverShow" });
        }
    </div>
    <div id="project_leftCol_outer">
        <div id="project_leftCol">
            <div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="" send="true" layout="button_count" width="500" show_faces="true" action="recommend" font="arial"></fb:like>

            <script type="text/javascript">
                document.write(VK.Share.button({ type: "round",
                    title: 'GoodWorx-Новость: @Model.Title',
                    description: '@Model.ShortContent',
                    image: '@(Model.NewsAvatar != null ? Model.NewsAvatar.Small.OriginalSizeUrl : Url.Absolute("/Content/img/logo_medium.jpg").ToString())',
                    text: "Поделиться"
                }));
            </script>
            @if (ViewBag.EditMode)
            {
            <div class="NewsShortContent">
                @Html.Partial("NewsShortContent", new Web.ViewModels.NewsShortContentModel(Model.Id, Model.ShortContent))
            </div>
            <hr/>
            }
            <div class="NewsContent">
                @Html.Partial("NewsContent", new Web.ViewModels.NewsContentModel(Model.Id, Model.Content))
            </div>
            <div class="both">
            </div>
            Автор: @Html.ActionLink(Model.Author.DisplayName, "View", "User",new {id = Model.Author.Id}, null)
            <br />
            <br />
            <div id="news_forum_container">
                <h2>
                    Обсуждение</h2>
                @Html.Action("Index", "Comment", new { story = Model })
            </div>
        </div>
    </div>
</div>
<div id="lightbox_shadow">
    &nbsp;</div>

<script type="text/javascript">
    $(document).ready(function () {
        $('a[rel=fancybox_gallery1]').fancybox();
    });
</script>


